<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
    table{
            border-collapse: collapse;
            text-align: center;
        }
        td{
            height: 30px;
            line-height: 30px;
            width: 100px;
            border: 1px solid #000;
        }
    </style>
</head>
<body>
    <table id="table">
        <tr>
            <td>1</td>
            <td>1</td>
        </tr>
        <tr>
            <td>2</td>
            <td>2</td>
        </tr>
        <tr id="tr3">
            <td>3</td>
            <td>3</td>
        </tr>
        <tr>
            <td>4</td>
            <td>4</td>
        </tr>
        <tr>
            <td>5</td>
            <td>5</td>
        </tr>
    </table>
    <script>
    var table = document.getElementById("table");
    var tr3 = document.getElementById("tr3");
    var td3 = document.getElementById("td3");
    var tbody = table.children[0]
    // table.removeChild(tr3);  为什么tr不是table的Child
    // tr3.parentNode.style.background = "#ccc"; 
    var tr = document.createElement("tr");
    var td = document.createElement("td");
    td.innerHTML = "新TR";
    tr.appendChild(td);
    tbody.appendChild(tr);

    tr3.parentNode.style.background = "#ccc"; 

    </script>
</body>
</html>